package com.neo.impatient.C04_MapTuple.C04_07_Tuple

object TupleTest {


  def main(args: Array[String]): Unit = {
    println("定义一个元组")
    val t = (1, 3.14, "Freed")
    println(t)
    println("访问元组")
    println(t._1)

    println("使用模式替换匹配来获取元组的值")
    val (first, second, third) = ("aa", "bb", "cc")

    println(first)
    println("使用模式替换匹配来获取元组的值")
    val (aa, bb, cc) = t
    println(aa)

    println("对于不需要的项目可以用'_' 占位")
    val (x,y,_) =t

    val kk = "New YYek".partition(_.isUpper)
    println(kk)

    val xx = "New5 YY3ser".partition(_.isLower)
    println(xx)
  }
}
